'''
# Coding:utf-8
# Project: iiop
# Author: rtf
# Time: 2021-04-16 14:20:13
# FileName: dynamic_word.py
# Software: PyCharm
'''

import html
import base64
import docx
import re
import bs4
from pathlib import Path
from docx.shared import Pt, Cm, Inches, RGBColor
from docx.oxml.ns import qn, nsdecls
from docx.oxml import parse_xml
from docx.enum.text import WD_ALIGN_PARAGRAPH, WD_PARAGRAPH_ALIGNMENT
from bs4 import BeautifulSoup
from func.root_path import get_path


IMAGE_MIME_TYPE = {"image/gif": "gif",
                   "image/png": "png",
                   "image/jpeg": "jpg",
                   "image/svg+xml": "svg"}


def save_image(img_str, image_name):
    # path = "../"
    path = get_path()
    mime_type = img_str[img_str.find(":") + 1:img_str.find(";")]
    img_str = img_str[len(mime_type) + 13:]
    img_data = base64.b64decode(img_str)
    filename = f'{path}/images/{image_name}.{IMAGE_MIME_TYPE.get(mime_type)}'
    with open(filename, 'wb') as f:
        f.write(img_data)
        f.close()
    return filename


async def dynamic_process(html_content, title, docx_path, level="first"):
    if html_content:
        html_content = html.unescape(html_content).replace('\\"', '"').replace('\\/', '/')
    doc = docx.Document(docx_path)
    if title:
        # p = doc.add_paragraph()
        # run = p.add_run(title)
        # run.bold = True
        # run.font.size = Pt(16)
        # run.font.name = "仿宋_GB2312"
        # run._element.rPr.rFonts.set(qn('w:eastAsia'), "仿宋_GB2312")
        # p_format = p.paragraph_format
        # p_format.first_line_indent = Inches(0)
        # p_format.line_spacing = Pt(29)
        # if level == "child":
        #     p.paragraph_format.first_line_indent = Pt(32)

        '''
            一级标题自带内容，不知道怎么去除，所以从二级开始
        '''
        if level == "child":
            p = doc.add_heading(level=3)
        else:
            p = doc.add_heading(level=2)
        run = p.add_run(title)
        run.font.size = Pt(16)
        run.font.name = "仿宋_GB2312"
        run.bold = True
        run._element.rPr.rFonts.set(qn('w:eastAsia'), "仿宋_GB2312")
        p_format = p.paragraph_format
        p_format.line_spacing = Pt(29)
        if level == "child":
            p_format.first_line_indent = Pt(32)
        else:
            p_format.first_line_indent = Inches(0)

    if html_content:
        soup = BeautifulSoup(html_content, 'html.parser')
        soup.prettify()
        for i in range(0, len(soup.contents)):
            if isinstance(soup.contents[i], bs4.element.Tag):
                p_style = str_to_json(soup.contents[i].attrs.get("style"))
                text = str()
                if not isinstance(soup.contents[i].tbody, int) and soup.contents[i].tbody:  # 表格
                    await create_table(doc, soup.contents[i].tbody)
                elif not isinstance(soup.contents[i].img, int) and soup.contents[i].img:  # 图片
                    image_info = soup.contents[i].img.attrs
                    # width = image_info.get("width") if image_info.get("width") else 5
                    # height = image_info.get("height") if image_info.get("height") else 5
                    # img_str = image_info.get("src")
                    #
                    # image_path = save_image(img_str, datetime.datetime.now().strftime('%Y%m%d%H%M%S%f'))
                    image_path = image_info.get("src")
                    image = Path(image_path)
                    if image.exists():
                        print("=========", image_path)
                        doc.add_picture(image_path, width=Inches(5))  # 添加图片
                        last_paragraph = doc.paragraphs[-1]
                        last_paragraph.alignment = WD_ALIGN_PARAGRAPH.CENTER
                # elif not isinstance(soup.contents[i].li, int) and soup.contents[i].li:
                #     ul_count = str(soup.contents[i]).count("<ul>")
                #     li_style = 'List Bullet' if ul_count else 'List Number'
                #     for x in range(0, len(soup.contents[i].contents)):
                #         if isinstance(soup.contents[i].contents[x], bs4.element.Tag):
                #             soup_li = soup.contents[i].contents[x].span
                #             doc.add_paragraph(
                #                 soup_li.text, style=li_style
                #             )

                elif (not isinstance(soup.contents[i].span, int) and soup.contents[i].span) or \
                        not isinstance(soup.contents[i].text, int) and soup.contents[i].text:  # 文本
                    for child in soup.contents[i].descendants:
                        if isinstance(child, bs4.element.NavigableString) and child:
                            if len(child) >= 1:
                                text += child.lstrip()
                        else:
                            style = str_to_json(child.attrs.get("style"))
                    p = doc.add_paragraph()
                    run = p.add_run(text)  # 使用add_run添加文字
                    run.font.name = "仿宋_GB2312"
                    run._element.rPr.rFonts.set(qn('w:eastAsia'), "仿宋_GB2312")
                    run.font.size = Pt(16)
                    p.paragraph_format.line_spacing = Pt(29)
                    p.paragraph_format.first_line_indent = Pt(32)
                    # if style:
                    #     if style.get("font-size"):
                    #         run.font.size = Pt(int(float(style.get("font-size")[:-2])))
                    #     else:
                    #         run.font.size = Pt(14)
                    #     if style.get("font-family"):
                    #         run.font.name = style.get("font-family")
                    #         if run._element.rPr.rFonts:
                    #             run._element.rPr.rFonts.set(qn('w:eastAsia'), style.get("font-family"))
                    #     if p_style:
                    #         # 首行缩进
                    #         if p_style.get("text-indent"):
                    #             p.paragraph_format.first_line_indent = Pt(int(float(p_style.get("text-indent")[:-2])))
                    #         else:
                    #             p.paragraph_format.first_line_indent = Pt(32)
                    #         if p_style.get("line-height"):
                    #             p.paragraph_format.line_spacing = Pt(int(float(p_style.get("line-height")[:-2])))
                    #         else:
                    #             p.paragraph_format.line_spacing = Pt(29)
                    # else:
                    #     run.font.name = "仿宋_GB2312"
                    #     # run._element.rPr.rFonts.set(qn('w:eastAsia'), "仿宋_GB2312")
                    #     run.font.size = Pt(14)
                    #     p.paragraph_format.line_spacing = Pt(29)


                else:
                    pass
    doc.save(docx_path)


def str_to_json(styles):
    if styles:
        styles = styles.split(";")
        style = dict()
        for s in styles:
            s = s.split(":")
            if len(s) > 1:
                style[s[0].strip()] = s[1].strip()
        return style
    else:
        None


def move_table_after(table, paragraph):
    tbl, p = table._tbl, paragraph._p
    p.addnext(tbl)


def delete_paragraph(paragraph):
    p = paragraph._element
    p.getparent().remove(p)
    p._p = p._element = None


async def create_table(doc, table_content):
    # 获取列数
    cols = 0
    for child in table_content.children:
        if isinstance(child, bs4.element.Tag):

            # 获取表格列 = td 数量 + （colspan - 1）
            merge_cols_num = 0
            for x in range(0, len(child.contents)):
                soup_col = child.contents[x]
                if isinstance(soup_col, bs4.element.Tag):
                    if soup_col != "\n" and soup_col != "\\n":
                        if soup_col.get("colspan"):
                            merge_cols_num += int(re.sub("\D", "", soup_col.get("colspan"))) - 1
            temp_cols = str(child).count("</td>")
            temp_cols += merge_cols_num
            if temp_cols > cols:
                cols = temp_cols
    # 获取行数
    rows = str(table_content).count("</tr>")
    # 添加一个空表
    table = doc.add_table(rows=rows, cols=cols, style='Table Grid')

    merge_rows = list()  # 需要合并的行
    merge_cols = list()  # 需要合并的列
    merge_rows_cols = list()  # 跨行跨列

    rowspan_merge = list()  # 行合并
    colspan_merge = list()  # 列合并
    cell_value = list()  # 单元格的值
    str_line = 0
    for row in range(0, len(table_content.contents)):
        soup_row = table_content.contents[row]
        if isinstance(soup_row, bs4.element.Tag):
            # 忽略列中的“\n”，获取实际列位置
            newline = 0
            for col in range(0, len(soup_row.contents)):
                soup_col = soup_row.contents[col]
                if isinstance(soup_col, bs4.element.Tag):
                    if soup_col != "\n" and soup_col != "\\n":
                        newline += 1

                # 实际列位置 = 原始位置 - 换行
                # 实际行位置 = 原始位置 - 空行
                real_col = col - newline
                real_row = row - str_line
                if isinstance(soup_col, bs4.element.Tag):
                    attrs = soup_col.attrs
                    colspan = int(re.sub("\D", "", attrs.get("colspan"))) if attrs.get("colspan") else None
                    rowspan = int(re.sub("\D", "", attrs.get("rowspan"))) if attrs.get("rowspan") else None

                    if colspan and rowspan:
                        for r in range(0, colspan):
                            merge_cell_cols = list()
                            for c in range(0, colspan):
                                if c == 0 or c == (colspan - 1):
                                    merge_cell_cols.append((real_row * (r + 1), real_col + c))
                            merge_cols.append(merge_cell_cols)
                        colspan_merge.append([(real_row, real_col), colspan])

                        merge_cell_rows = list()
                        for r in range(0, rowspan):
                            if r == 0 or r == (rowspan - 1):
                                merge_cell_rows.append((real_row + r, real_col))
                                if r == (rowspan - 1):
                                    merge_rows_cols.append((real_row + r, real_col + (rowspan - 1)))
                        merge_rows.append(merge_cell_rows)
                        rowspan_merge.append([(real_row, real_col), rowspan])
                    elif rowspan:
                        merge_cell_rows = list()
                        for r in range(0, rowspan):
                            if r == 0 or r == (rowspan - 1):
                                merge_cell_rows.append((real_row + r, real_col))
                        merge_rows.append(merge_cell_rows)
                        rowspan_merge.append([(real_row, real_col), rowspan])
                    elif colspan:
                        merge_cell_cols = list()
                        for c in range(0, colspan):
                            if c == 0 or c == (colspan - 1):
                                merge_cell_cols.append((real_row, real_col + c))
                        merge_cols.append(merge_cell_cols)
                        colspan_merge.append([(real_row, real_col), colspan])
                    else:
                        pass

                    text_style = None
                    if not isinstance(soup_col.span, int) and soup_col.span:
                        text_style = str_to_json(soup_col.span.get("style"))
                        if not isinstance(soup_col.strong, int) and soup_col.strong:
                            text_style["bold"] = True
                            text_style["font-family"] = "仿宋_GB2312"
                            text_style["font-size"] = "10.5"
                    cell_value.append([(real_row, real_col), soup_col.text.replace("\n", "").replace("\\n", "").replace("\xa0", ""),
                                       attrs, text_style])
        else:
            str_line += 1

    # 需要合并的单元格的实际位置
    for i, v in enumerate(merge_rows):
        for x in colspan_merge:
            if x[0][0] == v[0][0] and x[0][1] < v[0][1]:
                merge_rows[i] = [(v[0][0], v[0][1] + (x[1] - 1)), (v[1][0], v[1][1] + (x[1] - 1))]

    for i, v in enumerate(merge_cols):
        for x in rowspan_merge:
            if x[0][0] < v[0][0] and x[0][1] == v[0][1]:
                merge_cols[i] = [(v[0][0], v[0][1]), (v[1][0], v[1][1])]

    # 合并单元格
    for c in merge_cols:
        table.cell(c[0][0], c[0][1]).merge(table.cell(c[1][0], c[1][1]))

    for r in merge_rows:
        table.cell(r[0][0], r[0][1]).merge(table.cell(r[1][0], r[1][1]))

    # 单元格value的实际位置
    for i, v in enumerate(cell_value):
        for x in colspan_merge:
            if x[0][0] == v[0][0] and x[0][1] < v[0][1]:
                cell_value[i][0] = (v[0][0], v[0][1] + (x[1] - 1))
    for i, v in enumerate(cell_value):
        for x in merge_rows:
            if x[1][0] == v[0][0] and x[1][1] <= v[0][1]: # 跨行首尾行单元格value处理
                cell_value[i][0] = (v[0][0], v[0][1] + 1)
            elif x[0][0]< v[0][0] < x[1][0]: # 跨行中间行单元格value处理
                cell_value[i][0] = (v[0][0], v[0][1] + 1)
        for x in merge_rows_cols:
            if x[0] == v[0][0] and x[1] <= v[0][1]:
                cell_value[i][0] = (v[0][0], v[0][1] + 1)

    # 单元格赋值
    for v in cell_value:
        cell = table.cell(v[0][0], v[0][1])
        if v[2] and v[2].get("style"):
            style = str_to_json(v[2].get("style"))
            # 设置单元格背景色
            if style.get("background-color"):
                bg_color = style.get("background-color")[1:]
                cell._tc.get_or_add_tcPr().append(
                    parse_xml(r'<w:shd {} w:fill="{bgColor}"/>'.format(nsdecls('w'), bgColor=bg_color)))

        p = cell.paragraphs[0]
        p.paragraph_format.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER  # 设置对齐方式
        p.paragraph_format.alignment = WD_ALIGN_PARAGRAPH.CENTER

        run = p.add_run(v[1].strip() if v[1] else None)
        # 设置字体、大小
        run.font.name = "仿宋_GB2312"
        run.font.size = Pt(10.5)

        if v[3]:
            style = v[3]

            if style.get("font-size"):
                font_size = float(style.get("font-size")[:-2])
                run.font.size = Pt(font_size)
            # if style.get("font-family"):
            #     run.font.name = style.get("font-family")
            #     if run._element.rPr.rFonts:
            #         run._element.rPr.rFonts.set(qn('w:eastAsia'), style.get("font-family"))
            if style.get("bold"):
                run.font.bold = style.get("bold")
        # else:
        #     if style.get("font-size"):
        #         font_size = float(style.get("font-size")[:-2])
        #         run.font.size = Pt(font_size)
        #     if style.get("bold"):
        #         run.font.bold = style.get("bold")


html_content1 = '''
<table style="margin-left: 0pt; height: 232pt; width: 99.4334%; border: 0.5pt solid #000000;" border="0" cellspacing="0" cellpadding="0" align="center">
<tbody>
<tr style="height: 15.25pt;">
<td rowspan="2" style="width: 0%; background-color: #ddd9c3; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 57pt;" width="85">
<p style="text-align: center; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"><span style="font-family: 宋体; font-size: 9pt;"><strong>业务需求类别</strong></span></p>
</td>
<td rowspan="2" style="width: 0%; background-color: #ddd9c3; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 57pt;" width="160">
<p style="text-align: center; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"><span style="font-family: 宋体; font-size: 9pt;"><strong>业务需求描述</strong></span></p>
</td>
<td colspan="4" style="width: 0%; background-color: #ddd9c3; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 28pt;" width="265">
<p style="text-align: center; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"><span style="font-family: 宋体; font-size: 9pt;"><strong>业务应用对象</strong></span></p>
</td>
<td rowspan="2" style="width: 0%; background-color: #ddd9c3; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 57pt;" width="57">
<p style="text-align: center; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"><span style="font-family: 宋体; font-size: 9pt;"><strong>业务频次</strong></span></p>
</td>
</tr>
<tr style="height: 15.25pt;">
<td style="width: 0%; background-color: #ddd9c3; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 28pt;" width="74">
<p style="text-align: center; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"><span style="font-family: 宋体; font-size: 9pt;"><strong>层级</strong></span></p>
</td>
<td style="width: 0%; background-color: #ddd9c3; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 28pt;" width="64">
<p style="text-align: center; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"><span style="font-family: 宋体; font-size: 9pt;"><strong>专业名称</strong></span></p>
</td>
<td style="width: 0%; background-color: #ddd9c3; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 28pt;" width="64">
<p style="text-align: center; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"><span style="font-family: 宋体; font-size: 9pt;"><strong>岗位名称</strong></span></p>
</td>
<td style="width: 0%; background-color: #ddd9c3; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 28pt;" width="64">
<p style="text-align: center; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"><span style="font-family: 宋体; font-size: 9pt;"><strong>使用人数</strong></span></p>
</td>
</tr>
<tr style="height: 26.500000000000004pt;">
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="85">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"><span style="font-family: 宋体; font-size: 9pt;">新增/完善</span></p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="160">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 手动阀手动阀</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="74">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"><span style="font-family: 宋体; font-size: 9pt;">省/地市/县</span></p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="64">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;">地方改 </p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="64">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;">地方改 </p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="64">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 给就好</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="57">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;">给巨化股份 </p>
</td>
</tr>
<tr style="height: 26.500000000000004pt;">
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="85">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 士大夫</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="160">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 地方改</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="74">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 阿斯顿</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="64">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 地方改</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="64">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 地方改</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="64">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 规划局</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="57">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;">  建国后</p>
</td>
</tr>
<tr style="height: 26.500000000000004pt;">
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="85">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;">士大夫啊 </p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="160">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 地方改</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="74">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 额我让他</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="64">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 地方改</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="64">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;">地方改 </p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="64">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 华国锋</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 42pt;" width="57">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;">  感觉回复</p>
</td>
</tr>
<tr style="height: 26.500000000000004pt;">
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 41pt;" width="85">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;">问问太热 </p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 41pt;" width="160">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 不能</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 41pt;" width="74">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 地方改</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 41pt;" width="64">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;">  士大夫</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 41pt;" width="64">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 士大夫</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 41pt;" width="64">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 地方改</p>
</td>
<td style="width: 0%; padding: 0pt 5.38583pt; border: 0.5pt solid #000000; height: 41pt;" width="57">
<p style="text-align: center; mso-pagination: none; mso-line-height-rule: exactly; margin-top: 0pt; margin-bottom: 0pt; border: none; mso-border-left-alt: none; mso-border-top-alt: none; mso-border-right-alt: none; mso-border-bottom-alt: none; mso-border-between: none;"> 给九回复</p>
</td>
</tr>
</tbody>
</table>
'''

html_content2 = '''
<table border="1" style="border-collapse: collapse; width: 100%;">
<tbody>
<tr>
<td style="width: 19.1507%;">表头１</td>
<td style="width: 19.1507%;">表头２</td>
<td style="width: 19.1507%;">表头３</td>
<td colspan="2" style="width: 38.4532%; text-align: center;">表头４（合并两列）</td>
</tr>
<tr>
<td rowspan="2" style="width: 19.1507%;">合并（两行）</td>
<td style="width: 19.1507%;">软件</td>
<td style="width: 19.1507%;">硬件</td>
<td colspan="2" style="width: 38.4532%; text-align: center;">合并两列</td>
</tr>
<tr>
<td style="width: 19.1507%;">１</td>
<td style="width: 19.1507%;">１</td>
<td style="width: 19.2266%;">２</td>
<td style="width: 19.2266%;">２</td>
</tr>
<tr>
<td colspan="3" style="width: 57.4521%; text-align: center;">合并三列总计</td>
<td style="width: 19.2266%;">３</td>
<td style="width: 19.2266%;">４</td>
</tr>
</tbody>
</table>
'''

html_content3 = '''
<table border="1" style="border-collapse: collapse; width: 100%; height: 70px;">
<tbody>
<tr style="height: 14px;">
<td style="width: 11.6393%; height: 14px;">1</td>
<td style="width: 11.6393%; height: 14px;">2</td>
<td style="width: 11.6393%; height: 14px;">3</td>
<td style="width: 11.7152%; height: 14px;">43</td>
<td style="width: 11.7152%; height: 14px;">5</td>
<td style="width: 11.7152%; height: 14px;">5</td>
<td style="width: 11.7152%; height: 14px;">6</td>
<td style="width: 11.7152%; height: 14px;">7</td>
</tr>
<tr style="height: 14px;">
<td rowspan="2" style="height: 28px; width: 11.6393%;">硬件</td>
<td style="width: 11.6393%; height: 14px;">1</td>
<td style="width: 11.6393%; height: 14px;">1</td>
<td colspan="2" rowspan="2" style="height: 28px; width: 23.4304%; text-align: center;">没</td>
<td style="width: 11.7152%; height: 14px;">1</td>
<td style="width: 11.7152%; height: 14px;">3</td>
<td style="width: 11.7152%; height: 14px;">4</td>
</tr>
<tr style="height: 14px;">
<td style="width: 11.6393%; height: 14px;">2</td>
<td style="width: 11.6393%; height: 14px;">2</td>
<td style="width: 11.7152%; height: 14px;">2</td>
<td style="width: 11.7152%; height: 14px;">3</td>
<td style="width: 11.7152%; height: 14px;">5</td>
</tr>
<tr style="height: 14px;">
<td style="width: 11.6393%; height: 14px;"></td>
<td style="width: 11.6393%; height: 14px;"></td>
<td style="width: 11.6393%; height: 14px;"></td>
<td style="width: 11.7152%; height: 14px;"></td>
<td style="width: 11.7152%; height: 14px;"></td>
<td style="width: 11.7152%; height: 14px;"></td>
<td style="width: 11.7152%; height: 14px;"></td>
<td style="width: 11.7152%; height: 14px;"></td>
</tr>
<tr style="height: 14px;">
<td style="width: 11.6393%; height: 14px;"></td>
<td style="width: 11.6393%; height: 14px;"></td>
<td style="width: 11.6393%; height: 14px;"></td>
<td style="width: 11.7152%; height: 14px;"></td>
<td style="width: 11.7152%; height: 14px;"></td>
<td style="width: 11.7152%; height: 14px;"></td>
<td style="width: 11.7152%; height: 14px;"></td>
<td style="width: 11.7152%; height: 14px;"></td>
</tr>
</tbody>
</table>
'''

html_content4 = '''
<table border="1" style="border-collapse: collapse; width: 100%; height: 70px;">
<tbody>
<tr style="height: 14.2500pt;">
<td style="width: 0%; padding: 0pt; border-width: 1pt; border-color: windowtext; height: 24pt;" valign="center" width="63">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">出资单位</span></strong></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top-width: 1pt; border-top-color: windowtext; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 24pt;" valign="center" width="56">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">部署地</span></strong></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top-width: 1pt; border-top-color: windowtext; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 24pt;" valign="center" width="53">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">软硬件</span></strong></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top-width: 1pt; border-top-color: windowtext; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 24pt;" valign="center" width="76">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">设备类型</span></strong></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top-width: 1pt; border-top-color: windowtext; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 24pt;" valign="center" width="203">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">配置</span></strong></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top-width: 1pt; border-top-color: windowtext; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 24pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">单位</span></strong></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top-width: 1pt; border-top-color: windowtext; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 24pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">单价</span></strong></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top-width: 1pt; border-top-color: windowtext; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 24pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">数量</span></strong></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top-width: 1pt; border-top-color: windowtext; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 24pt;" valign="center" width="51">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">合计</span></strong></p>
</td>
</tr>
<tr style="height: 14.2500pt;">
<td rowspan="3" style="padding: 0pt; border-left-width: 1pt; border-left-color: windowtext; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; width: 0%; text-align: center; height: 111pt;" valign="center" width="63">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> </span></p>
<span style="font-size: 10pt;">国家电网</span><br/>
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt; text-align: center;"><span style="font-family: 宋体; font-size: 10.5pt;"> </span></p>
<br/>
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> </span></p>
</td>
<td rowspan="3" style="padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; width: 0%; text-align: center; height: 111pt;" valign="center" width="56">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> </span></p>
兰州 <br/>
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> </span></p>
<br/>
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="53">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">大屏 </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="76">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">服务器</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="203">
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 123</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 123</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 123</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">2 </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="51">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">234 </span></p>
</td>
</tr>
<tr style="height: 14.2500pt;">
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 37pt;" valign="center" width="53">
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt; text-align: center;"><span style="font-family: 宋体; font-size: 10.5pt;"> 士大夫</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 37pt;" valign="center" width="76">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 的  大师傅士大夫</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 37pt;" valign="center" width="203">
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt;"><span style="font-family: 宋体; font-size: 10.5pt;">  稍等</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 37pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">  阿斯顿</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 37pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 稍等 </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 37pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">2 </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 37pt;" valign="center" width="51">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">231 </span></p>
</td>
</tr>
<tr style="height: 14.2500pt;">
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 37pt;" valign="center" width="53">
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt; text-align: center;"><span style="font-family: 宋体; font-size: 10.5pt;"> 似懂非懂</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 37pt;" valign="center" width="76">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">士大夫 </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 37pt;" valign="center" width="203">
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 地方</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 37pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">士大夫 </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 37pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">士大夫 </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 37pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">23 </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 37pt;" valign="center" width="51">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">1</span></p>
</td>
</tr>
<tr style="height: 14.2500pt;">
<td rowspan="3" style="padding: 0pt; border-left-width: 1pt; border-left-color: windowtext; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; width: 0%; height: 108pt;" valign="center" width="63">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> </span></p>
<br/>
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt; text-align: center;"><span style="font-family: 宋体; font-size: 10.5pt;"> 金诺安</span></p>
<br/>
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> </span></p>
</td>
<td rowspan="3" style="padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; width: 0%; height: 108pt;" valign="center" width="56">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> </span></p>
<br/>
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt; text-align: center;"><span style="font-family: 宋体; font-size: 10.5pt;">兰州 </span></p>
<br/>
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt; text-align: center;"><span style="font-family: 宋体; font-size: 10.5pt;"> </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="53">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 地方</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="76">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">地方 </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="203">
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 第三方</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">地方 </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">第三方 </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">43 </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="51">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">2 </span></p>
</td>
</tr>
<tr style="height: 14.2500pt;">
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="53">
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt; text-align: center;"><span style="font-family: 宋体; font-size: 10.5pt;"> 士大夫</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="76">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">士大夫 </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="203">
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 地方</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 地方</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 士大夫</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 12</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="51">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 234</span></p>
</td>
</tr>
<tr style="height: 14.2500pt;">
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="53">
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt; text-align: center;"><span style="font-family: 宋体; font-size: 10.5pt;"> 士大夫</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="76">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 地方</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="203">
<p class="MsoNormal" style="margin: 0pt; text-indent: 0pt; line-height: 12pt;"><span style="font-family: 宋体; font-size: 10.5pt;">  非得</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">  士大夫</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;"> 发生的 </span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="37">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">  54</span></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 36pt;" valign="center" width="51">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><span style="font-family: 宋体; font-size: 10.5pt;">213 </span></p>
</td>
</tr>
<tr style="height: 14.2500pt;">
<td colspan="8" style="width: 0%; padding: 0pt; border-left-width: 1pt; border-left-color: windowtext; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 22pt;" valign="center" width="567">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">总计</span></strong></p>
</td>
<td style="width: 0%; padding: 0pt; border-left: none; border-right-width: 1pt; border-right-color: windowtext; border-top: none; border-bottom-width: 1pt; border-bottom-color: windowtext; height: 22pt;" valign="center" width="51">
<p align="center" class="MsoNormal" style="text-indent: 0.0000pt; mso-char-indent-count: 0.0000; mso-pagination: widow-orphan; text-align: center; line-height: 12.0000pt; mso-line-height-rule: exactly; margin: 0.0000pt;">2344</p>
</td>
</tr>
</tbody>
</table>
'''

html_content5= '''
<table style="border-collapse: collapse; width: 100%; height: 46pt;" border="1">
<tbody>

<tr style="height: 19.4453pt;">

<td style="width: 11.1041%; text-align: center; height: 10pt;"><span style="font-size: 10pt;"><strong>出资单位</strong></span></td>

<td style="width: 11.1041%; text-align: center; height: 10pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">部署地</span></strong></td>

<td style="width: 11.1041%; text-align: center; height: 10pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">软硬件</span></strong></td>

<td style="width: 11.1041%; text-align: center; height: 10pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">设备类型</span></strong></td>

<td style="width: 11.1041%; text-align: center; height: 10pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">配置</span></strong></td>

<td style="width: 11.1041%; text-align: center; height: 10pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">单位</span></strong></td>

<td style="width: 11.1041%; height: 10pt; text-align: center;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">单价</span></strong></td>

<td style="width: 11.1041%; height: 10pt; text-align: center;">&nbsp;<strong><span style="font-family: 宋体; font-size: 10.5pt;">数量</span></strong></td>

<td style="width: 11.1675%; height: 10pt; text-align: center;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">合计</span></strong></td>
</tr>

<tr style="height: 16.5976pt;">

<td style="height: 27pt; width: 11.1041%;" rowspan="4">111</td>

<td style="height: 27pt; width: 11.1041%;" rowspan="4">1111</td>

<td style="width: 11.1041%; height: 9pt;">1</td>

<td style="width: 11.1041%; height: 9pt;">2</td>

<td style="width: 11.1041%; height: 9pt;">3</td>

<td style="width: 11.1041%; height: 9pt;">4</td>

<td style="width: 11.1041%; height: 9pt;">5</td>

<td style="width: 11.1041%; height: 9pt;">6</td>

<td style="width: 11.1675%; height: 9pt;">7</td>
</tr>

<tr style="height: 16.5976pt;">

<td style="width: 11.1041%; height: 9pt;">1</td>

<td style="width: 11.1041%; height: 9pt;">2</td>

<td style="width: 11.1041%; height: 9pt;">3</td>

<td style="width: 11.1041%; height: 9pt;">4</td>

<td style="width: 11.1041%; height: 9pt;">5</td>

<td style="width: 11.1041%; height: 9pt;">6</td>

<td style="width: 11.1675%; height: 9pt;">7</td>
</tr>

<tr style="height: 16.5976pt;">

<td style="width: 11.1041%; height: 9pt;">1</td>

<td style="width: 11.1041%; height: 9pt;">2</td>

<td style="width: 11.1041%; height: 9pt;">3</td>

<td style="width: 11.1041%; height: 9pt;">4</td>

<td style="width: 11.1041%; height: 9pt;">5</td>

<td style="width: 11.1041%; height: 9pt;">6</td>

<td style="width: 11.1675%; height: 9pt;">7</td>
</tr>

<tr style="height: 16.5976pt;">

<td style="width: 11.1041%; height: 9pt;">1</td>

<td style="width: 11.1041%; height: 9pt;">2</td>

<td style="width: 11.1041%; height: 9pt;">3</td>

<td style="width: 11.1041%; height: 9pt;">4</td>

<td style="width: 11.1041%; height: 9pt;">5</td>

<td style="width: 11.1041%; height: 9pt;">6</td>

<td style="width: 11.1675%; height: 9pt;">7</td>
</tr>


<tr style="height: 16.5976pt;">

<td style="height: 27pt; width: 11.1041%;" rowspan="3">111</td>

<td style="height: 27pt; width: 11.1041%;" rowspan="3">1111</td>

<td style="width: 11.1041%; height: 9pt;">1</td>

<td style="width: 11.1041%; height: 9pt;">2</td>

<td style="width: 11.1041%; height: 9pt;">3</td>

<td style="width: 11.1041%; height: 9pt;">4</td>

<td style="width: 11.1041%; height: 9pt;">5</td>

<td style="width: 11.1041%; height: 9pt;">6</td>

<td style="width: 11.1675%; height: 9pt;">7</td>
</tr>

<tr style="height: 16.5976pt;">

<td style="width: 11.1041%; height: 9pt;">1</td>

<td style="width: 11.1041%; height: 9pt;">2</td>

<td style="width: 11.1041%; height: 9pt;">3</td>

<td style="width: 11.1041%; height: 9pt;">4</td>

<td style="width: 11.1041%; height: 9pt;">5</td>

<td style="width: 11.1041%; height: 9pt;">6</td>

<td style="width: 11.1675%; height: 9pt;">7</td>
</tr>

<tr style="height: 16.5976pt;">

<td style="width: 11.1041%; height: 9pt;">1</td>

<td style="width: 11.1041%; height: 9pt;">2</td>

<td style="width: 11.1041%; height: 9pt;">3</td>

<td style="width: 11.1041%; height: 9pt;">4</td>

<td style="width: 11.1041%; height: 9pt;">5</td>

<td style="width: 11.1041%; height: 9pt;">6</td>

<td style="width: 11.1675%; height: 9pt;">7</td>
</tr>



<tr style="height: 16.5976pt;">

<td style="height: 9pt; width: 88.8325%;" colspan="8"><strong style="text-align: center;"><span style="font-size: 12pt;">总计</span></strong></td>

<td style="width: 11.1675%; height: 9pt;">3</td>
</tr>

<tbody>
</table>
'''

html_content6= '''
<table style="border-collapse: collapse; width: 100%; height: 46pt;" border="1">
<tbody>

<tr style="height: 19.4453pt;">

<td style="width: 11.1041%; text-align: center; height: 10pt;"><span style="font-size: 10pt;"><strong>出资单位</strong></span></td>

<td style="width: 11.1041%; text-align: center; height: 10pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">部署地</span></strong></td>

<td style="width: 11.1041%; text-align: center; height: 10pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">软硬件</span></strong></td>

<td style="width: 11.1041%; text-align: center; height: 10pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">设备类型</span></strong></td>

<td style="width: 11.1041%; text-align: center; height: 10pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">配置</span></strong></td>

<td style="width: 11.1041%; text-align: center; height: 10pt;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">单位</span></strong></td>

<td style="width: 11.1041%; height: 10pt; text-align: center;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">单价</span></strong></td>

<td style="width: 11.1041%; height: 10pt; text-align: center;">&nbsp;<strong><span style="font-family: 宋体; font-size: 10.5pt;">数量</span></strong></td>

<td style="width: 11.1675%; height: 10pt; text-align: center;"><strong><span style="font-family: 宋体; font-size: 10.5pt;">合计</span></strong></td>
</tr>

<tr style="height: 16.5976pt;">

<td style="height: 27pt; width: 11.1041%;" rowspan="4">111</td>


<td style="width: 11.1041%; height: 9pt;">0</td>

<td style="width: 11.1041%; height: 9pt;">1</td>

<td style="width: 11.1041%; height: 9pt;">2</td>

<td style="width: 11.1041%; height: 9pt;">3</td>

<td style="width: 11.1041%; height: 9pt;">4</td>

<td style="width: 11.1041%; height: 9pt;">5</td>

<td style="width: 11.1041%; height: 9pt;">6</td>

<td style="width: 11.1675%; height: 9pt;">7</td>
</tr>

<tr style="height: 16.5976pt;">
<td style="width: 11.1041%; height: 9pt;">0</td>
<td style="width: 11.1041%; height: 9pt;">1</td>

<td style="width: 11.1041%; height: 9pt;">2</td>

<td style="width: 11.1041%; height: 9pt;">3</td>

<td style="width: 11.1041%; height: 9pt;">4</td>

<td style="width: 11.1041%; height: 9pt;">5</td>

<td style="width: 11.1041%; height: 9pt;">6</td>

<td style="width: 11.1675%; height: 9pt;">7</td>
</tr>

<tr style="height: 16.5976pt;">
<td style="width: 11.1041%; height: 9pt;">0</td>
<td style="width: 11.1041%; height: 9pt;">1</td>

<td style="width: 11.1041%; height: 9pt;">2</td>

<td style="width: 11.1041%; height: 9pt;">3</td>

<td style="width: 11.1041%; height: 9pt;">4</td>

<td style="width: 11.1041%; height: 9pt;">5</td>

<td style="width: 11.1041%; height: 9pt;">6</td>

<td style="width: 11.1675%; height: 9pt;">7</td>
</tr>

<tr style="height: 16.5976pt;">
<td style="width: 11.1041%; height: 9pt;">0</td>
<td style="width: 11.1041%; height: 9pt;">1</td>

<td style="width: 11.1041%; height: 9pt;">2</td>

<td style="width: 11.1041%; height: 9pt;">3</td>

<td style="width: 11.1041%; height: 9pt;">4</td>

<td style="width: 11.1041%; height: 9pt;">5</td>

<td style="width: 11.1041%; height: 9pt;">6</td>

<td style="width: 11.1675%; height: 9pt;">7</td>
</tr>


<tr style="height: 16.5976pt;">

<td style="height: 27pt; width: 11.1041%;" rowspan="3">111</td>

<td style="height: 27pt; width: 11.1041%;" rowspan="3">1111</td>

<td style="width: 11.1041%; height: 9pt;">1</td>

<td style="width: 11.1041%; height: 9pt;">2</td>

<td style="width: 11.1041%; height: 9pt;">3</td>

<td style="width: 11.1041%; height: 9pt;">4</td>

<td style="width: 11.1041%; height: 9pt;">5</td>

<td style="width: 11.1041%; height: 9pt;">6</td>

<td style="width: 11.1675%; height: 9pt;">7</td>
</tr>

<tr style="height: 16.5976pt;">

<td style="width: 11.1041%; height: 9pt;">1</td>

<td style="width: 11.1041%; height: 9pt;">2</td>

<td style="width: 11.1041%; height: 9pt;">3</td>

<td style="width: 11.1041%; height: 9pt;">4</td>

<td style="width: 11.1041%; height: 9pt;">5</td>

<td style="width: 11.1041%; height: 9pt;">6</td>

<td style="width: 11.1675%; height: 9pt;">7</td>
</tr>

<tr style="height: 16.5976pt;">

<td style="width: 11.1041%; height: 9pt;">1</td>

<td style="width: 11.1041%; height: 9pt;">2</td>

<td style="width: 11.1041%; height: 9pt;">3</td>

<td style="width: 11.1041%; height: 9pt;">4</td>

<td style="width: 11.1041%; height: 9pt;">5</td>

<td style="width: 11.1041%; height: 9pt;">6</td>

<td style="width: 11.1675%; height: 9pt;">7</td>
</tr>



<tr style="height: 16.5976pt;">

<td style="height: 9pt; width: 88.8325%;" colspan="8"><strong style="text-align: center;"><span style="font-size: 12pt;">总计</span></strong></td>

<td style="width: 11.1675%; height: 9pt;">3</td>
</tr>

<tbody>
</table>
'''

PURCHASE_CATEGORY = [
    {
        "general_remarks": "1 总论",
        "child": [
             {"mostly_according": "1.1 主要依据"},  {"necessity_analysis": "1.2 必要性分析"},
             {"benefit_analysis": "1.3 效益分析"}
        ]
    },
    {
        "demand_analysis": "2 需求分析"
    },
    {
        "construction_plan": "3 建设方案",
        "child": [
            {"building_goal": "3.1 建设目标"}, {"building_content": "3.2 建设内容"}
        ]
    },
    {
        "design": "4 设计方案",
        "child": [
            {"deployment_scope": "4.1 部署范围"}, {"deployment_plan": "4.2 部署方案"},
            {"sf_requirements": "4.3 软硬件需求"}
        ]
    },
    {
        "material_inventory": "5 主要设备材料清册"
    },
    {
        "estimate": "6 估算书",
        "child": [
            {"overview": "6.1 概述"}, {"compilation_principles_basis": "6.2 编制原则和依据"},
            {"investment_analysis": "6.3 投资分析"}, {"economic_evaluation_analysis": "6.4 经济性评价分析"}
        ]
    }]


# docx_path = "/home/rtf/Project/Jna/iiop/download/doc/test2.docx"
#
#
# def create_test(html_content, docx_path):
#     doc = docx.Document(docx_path)
#     if html_content:
#         soup = BeautifulSoup(html_content, 'html.parser')
#         soup.prettify()
#         for i in range(0, len(soup.contents)):
#             if isinstance(soup.contents[i], bs4.element.Tag):
#                 create_table(doc, soup.contents[i].tbody)
#     doc.save(docx_path)
#
# create_test(html_content, docx_path)

# def dynamic_process1(title, docx_path, level="first"):
#     doc = docx.Document(docx_path)
#     if title:
#         if level == "child":
#             p = doc.add_heading('', level=2)
#         else:
#             p = doc.add_heading('', level=1)
#         run = p.add_run(title)
#         run.font.size = Pt(16)
#         run.font.name = "仿宋_GB2312"
#         run._element.rPr.rFonts.set(qn('w:eastAsia'), "仿宋_GB2312")
#         p_format = p.paragraph_format
#         p_format.line_spacing = Pt(29)
#         if level == "child":
#             p_format.first_line_indent = Pt(32)
#         else:
#             p_format.first_line_indent = Inches(0)
#     doc.save(docx_path)
#
#
# for titles in PURCHASE_CATEGORY:
#     for k, v in titles.items():
#         if "child" in list(titles.keys()):
#             if k == "child":
#                 for child in v:
#                     for key, value in child.items():
#                         dynamic_process1(value, docx_path, level="child")
#             else:
#                 parent_key = k
#                 dynamic_process1(v, docx_path)
#         else:
#             dynamic_process1(v, docx_path)